package day04;

public class Person implements Comparable<Person>{
    private int id;

    private String name;

    private int sex;

    private String date;

    private String bm;

    private double money;

    public Person(int id, String name, int sex, String date, String bm, double money) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.date = date;
        this.bm = bm;
        this.money = money;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getBm() {
        return bm;
    }

    public void setBm(String bm) {
        this.bm = bm;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", date='" + date + '\'' +
                ", bm='" + bm + '\'' +
                ", money=" + money +
                '}';
    }

    @Override
    public int compareTo(Person o) {
        if (this.getMoney() > o.getMoney()){
            return -1;
        }
        return 1;
    }
}


